Lots of scrolling fixes. Made scrolling work properly in not fully
authorKristian Rietveld <kris@gtk.org>
Tue, 26 Dec 2006 16:13:02 +0000 (16:13 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Tue, 26 Dec 2006 16:13:02 +0000 (16:13 +0000)
commita3bc63b9e23081c2405a18e63a81d86458fd6e75
tree4a0a24eefe60bb3891ea49e0dd0e50c8441e4ab4
parent0b75f7a30f45203f1dbf24ddedd26feebb686fe7
Lots of scrolling fixes. Made scrolling work properly in not fully

2006-12-26  Kristian Rietveld  <kris@gtk.org>

Lots of scrolling fixes.  Made scrolling work properly in not fully
validated tree views; fixed a bunch of corner cases.

* gtk/gtktreeview.c (validate_visible_area): if a row's dy is past
upper - page_size, we know it is located at the end so the test for
dy + height has been dropped.
In the same case if area_below < 0, we know this is the last node
in the tree view so area_above is page_size - height of this row.
(validate_visible_area): got rid of subtracting new_height -
old_height from area_{below,above}, it didn't make any sense at
all and the full height of the row should be subtracted instead.
(validate_visible_area): when scrolling to a given path, set the
top row directly together with the dy offset, then sync that top_row
to the dy.
(gtk_tree_view_set_top_row): new function to directly set a top_row.
(gtk_tree_view_dy_to_top_row): refactored to use
gtk_tree_view_set_top_row().
(gtk_tree_view_top_row_to_dy): make sure dy >= 0 when done.
(gtk_tree_view_adjustment_changed): only update our dy and
top_row if the adjustment's dy actually changed.
ChangeLog
gtk/gtktreeview.c